package edu.fudan.cse.medlab.event.crawler;

import edu.fudan.cse.medlab.event.filter.Settings;

public class Proxy {
	
	public static void setProxy(){
		Settings setting = new Settings();
		Proxy.setProxy(setting);
	}
	
	public static void setProxy(Settings setting){
//		if(setting.proxyhost==null || setting.proxyhost=="")
//			return; 
//		System.setProperty("http.proxySet",   "true"); 	//http
//		System.setProperty("http.proxyHost", setting.proxyhost);  
//		System.setProperty("http.proxyPort", setting.proxyport);  
//		
//		if(setting.proxyusername.equals(""))
//			return;
//		System.setProperty("http.proxyUser", setting.proxyusername);  
//		System.setProperty("http.proxyPassword", setting.proxypassword);
		
		if(setting.proxyhost==null || setting.proxyhost.equals(""))
			return; 
		Client.proxyhost = setting.proxyhost;
		Client.proxyport = Integer.parseInt(setting.proxyport);
		if(setting.proxyusername.equals(""))
			return;
		Client.proxyusername = setting.proxyusername;
		Client.proxypassword = setting.proxypassword;
	}
	
}
